<!doctype html>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"
	/>
	<meta name="format-detection" content="tephone=no,email=no,date=no,address=no">
	<link rel="stylesheet" type="text/css" href="../css/aui.css" />
	<style type="text/css">
		.aui-tab-item.aui-active {
			color: #ff3333;
			border-bottom: 2px solid #ff3333;
		}
	</style>
</head>

<body>
	<div class="aui-tab" id="tab">
		<div class="aui-tab-item aui-active">直播</div>
		<div class="aui-tab-item">聊天</div>
	</div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/aui-tab.js"></script>
<script type="text/javascript" src="../script/vue.min.js"></script>
<script type="text/javascript" src="../script/sockjs.js"></script>
<script type="text/javascript" src="../script/stomp.min.js"></script>
<script type="text/javascript">
	var vm;
	apiready = function () {
		var liveId = api.pageParam.id;
		api.openFrameGroup({
			name: 'live_msg_group',
			scrollEnabled: false,
			rect: {
				x: 0,
				y: $api.byId('tab').offsetHeight,
				w: 'auto',
				h: 'auto'
			},
			index: 0,
			frames: [{
				name: 'live_msg_main_frm',
				url: './live_msg_main_frm.html'
			}, {
				name: 'live_msg_chat_frm',
				url: './live_msg_chat_frm.html'
			}],
			pageParam: {
				id: api.pageParam.id
			}
		}, function (ret, err) {

		});

		var tab = new auiTab({
			element: document.getElementById("tab")
		}, function (ret) {
			if (ret) {
				alert(ret.index);
				// switch (ret.index) {
				// 	case 1:

				// 		break;
				// 	case 2:

				// 		break;
				// }
				api.setFrameGroupIndex({
					name: 'live_msg_group',
					index: ret.index - 1,
					scroll: true
				});
			}
		});
	};

</script>

</html>